<!DOCTYPE html>
<html>
<head>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/jsp/head.jsp"%>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/js/lib/bootstrap/css/bootstrap-tree.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/js/lib/bootstrap/css/bootstrap-table.css">
<script src="${pageContext.request.contextPath}/static/js/lib/bootstrap/js/bootstrap-table.js"></script>
<script src="${pageContext.request.contextPath}/static/js/lib/bootstrap/js/bootstrap-tree.js"></script>
<script src="${pageContext.request.contextPath}/static/js/lib/bootstrap/js/bootstrap-menu.js"></script>
<script src="${pageContext.request.contextPath}/static/js/lib/bootstrap/js/bootstrap-radio.js"></script>
<script src="${pageContext.request.contextPath}/static/js/menu.js"></script>
<script src="${pageContext.request.contextPath}/static/js/data/data.js"></script>
<script src="${pageContext.request.contextPath}/static/js/data/user.js"></script>
<script type="text/javascript">
$(function () {
	$("#simpleRadio").BootstrapRadio({
		name: 'simpleRadio',
		data: [
		       {value: 10000, text: "测试1"},
		       {value: 20000, text: "测试2"},
		       {value: 30000, text: "测试3"},
		   ]
	});
	
	$("#remoteRadio").BootstrapRadio({
		name: 'remoteRadio',
		url: basePath+'/BaGroupController/getGroupList',
        valueField: 'groupId',
        textField: 'groupName',
	});	
});

function getSelectData(){
	var selectData = $("#simpleRadio").BootstrapRadio('getSelectData');
	alert(JSON.stringify(selectData));
}

function getValue(){
	var value = $("#remoteRadio").BootstrapRadio('getValue');
	alert(value);
}

</script>
</head>

<body>  
	<div class="container">  
		<nav id="menu"></nav>
		
		<div class="panel panel-default">
	        <div class="panel-heading">单选框</div>
			<div class="panel-body">
			    <div class="row">
			        <div class="col-xs-4">
			            <div id="simpleRadio"></div>
			        </div>			        
			    </div>
			    <div style="margin: 10px 0px"><button class="btn btn-primary btn-sm btn-search" type="button" onclick="getSelectData()">获取选择数据</button></div>
		     </div>
		     <div class="panel-footer">
		     </div>	
	    </div>

		<div class="panel panel-default">
	        <div class="panel-heading">远程调用单选框</div>
			<div class="panel-body">
			    <div class="row">
			        <div class="col-xs-4">
			            <div id="remoteRadio"></div>
			        </div>
			    </div>
			    <div style="margin: 10px 0px"><button class="btn btn-primary btn-sm btn-search" type="button" onclick="getValue()">获取选择值</button></div>
		     </div>
		     <div class="panel-footer">
		     </div>	
	    </div>
		
    </div>
</body>

</html>